package demo9;

import java.util.Calendar;
import java.util.Date;

public class test1 {
    public static void main(String[] args) {
//		Calendar c = Calendar.getInstance();
//		System.out.println(c);

        //修改一下日历代表的时间
        Calendar c = Calendar.getInstance();

        Date d = new Date(0L);
        c.setTime(d);

        System.out.println(c);

        c.set(Calendar.YEAR,2000);
        //输入的月份大于12的年自动向后推一年
        c.set(Calendar.MONTH,13);




        int year = c.get(1);
        int month = c.get(2);
        int date = c.get(5);

        System.out.println(year+","+(month+1)+","+date);
        System.out.println(week(1));

    }
    public static String week(int index) {

        String[] arr ={"","星期日","星期一","星期二","星期三","星期五","星期六"};

        return arr[index];
    }
}
